using System;

namespace Expect.Core
{
    using System.Reflection;
    using Expect.Core.Interfaces;

    /// <summary>
    /// Service contract for the catalog of spec and fixture implementations
    /// </summary>
    public interface IExpectCatalog
    {
        /// <summary>
        /// Name provider for catalog
        /// </summary>
        INameProvider NameProvider { get; }

        /// <summary>
        /// Get the type of the object given it's class name
        /// </summary>
        /// <param name="specificationname"></param>
        /// <returns></returns>
        Type GetSpecification(string specificationname);

        /// <summary>
        /// Get the type of the object given it's class name
        /// </summary>
        /// <param name="fixturename"></param>
        /// <returns></returns>
        Type GetFixture(string fixturename);

        /// <summary>
        /// Import types from the assembly
        /// </summary>
        /// <param name="ass"></param>
        void ImportTypes(Assembly ass);

        /// <summary>
        /// Convert a string to target type
        /// </summary>
        /// <param name="targetType">target type</param>
        /// <param name="val">string representation</param>
        /// <returns>target type instance</returns>
        object GetValue(Type targetType, string val);

        /// <summary>
        /// Get a named specification container
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        ISpecificationContainer GetContainerFor(string name);
    }
}